package com.fzu.ess.common.controller;

import com.fzu.ess.common.Const;
import com.fzu.ess.common.service.ImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * @author ercha
 * @ClassName: UploadController
 * @Description: //一句话功能简述/表所属模块
 * @Date 2015/12/03 19:35
 * @History:// 历史修改记录
 * <author>  // 修改人1
 * <time>    // 修改时间
 * <desc>    // 描述修改内容
 **/
@Controller
public class ImageController {
    @Autowired
    private ImageService imageService;

    @RequestMapping(value = "/images/{filename}.{extension}", method = RequestMethod.GET)
    public void getImage(@PathVariable String filename, @PathVariable String extension,
                       HttpServletResponse response){
        imageService.getImage(filename, extension, response);
    }
}
